Column

Restaurant coordinates by restaurant name and inspection grade

nyc_inspections_cleaned |>
  mutate(text_label = str_c("\nGrade:", grade, "\nRestaurant:", restaurant)) |> 
  plot_ly(
    x = ~latitude, y = ~longitude, type = "scatter", mode = "markers",
    color = ~grade, text = ~text_label, alpha = 0.5)
## Warning: Ignoring 170 observations

Column

Inspection score distribution by borough

nyc_inspections_cleaned |> 
  mutate(boro = fct_reorder(boro, score)) |> 
  plot_ly(y = ~score, color = ~boro, type = "box", colors = "viridis")
## Warning: There were 3 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `boro = fct_reorder(boro, score)`.
## Caused by warning:
## ! `fct_reorder()` removing 18 missing values.
## ℹ Use `.na_rm = TRUE` to silence this message.
## ℹ Use `.na_rm = FALSE` to preserve NAs.
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 2 remaining warnings.
## Warning: Ignoring 18 observations

Cuisine type distribution

nyc_inspections_cleaned |> 
  count(cuisine_description) |> 
  mutate(cuisine_description = fct_reorder(cuisine_description, n)) |> 
  plot_ly(x = ~cuisine_description, y = ~n, color = ~cuisine_description, type = "bar", colors = "viridis")